'''
Created on 2009-6-19

@author: roamer
'''

class Util:
    @staticmethod
    def Combination(items, n=None):
        if n is None:
            n = len(items)  
        for i in range(len(items)):
            v = items[i:i+1]
            if n == 1:
                yield v
            else:
                rest = items[i+1:]
                for c in Util.Combination(rest, n-1):
                    yield v + c